package com.huawei.gamebox.service.welfare.gift.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout.LayoutParams;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.gamebox.service.welfare.common.card.GsTitleCard;
import com.huawei.gamebox.service.welfare.common.card.SearchGiftTitleCard;
import com.huawei.gamebox.service.welfare.gift.card.BaseGiftCard;
import com.huawei.gamebox.service.welfare.gift.card.VerticalScrollGiftListCard;
import java.util.ArrayList;
import o.azb;
import o.cgz;
import o.dof;
import o.dyf;
import o.epv;
import o.exp$a;
import o.exp.d;
import o.exp.j;
import o.fby;

public class SearchGiftListNode extends VerticalGiftListLineNode {
    public SearchGiftListNode(Context context) {
        super(context);
    }

    protected View ॱ(LayoutInflater layoutInflater) {
        View ॱ = super.ॱ(layoutInflater);
        if (ॱ != null) {
            LinearLayout linearLayout = (LinearLayout) ॱ.findViewById(d.ˎ);
            if (linearLayout != null) {
                linearLayout.setMinimumHeight(this.ॱ.getResources().getDimensionPixelSize(exp$a.ʻ) - linearLayout.getPaddingBottom());
                linearLayout.setPaddingRelative(linearLayout.getPaddingStart(), linearLayout.getPaddingTop(), linearLayout.getPaddingEnd(), 0);
            }
        }
        return ॱ;
    }

    protected GsTitleCard ʼ() {
        return new SearchGiftTitleCard(this.ॱ);
    }

    protected boolean ॱॱ() {
        return false;
    }

    void ˊ(BaseGiftCard baseGiftCard, int i) {
        if (i > 3) {
            i = 3;
        }
        super.ˊ(baseGiftCard, i);
    }

    protected View ˊ(LayoutInflater layoutInflater) {
        View inflate = layoutInflater.inflate(j.ˑ, null);
        View findViewById = inflate.findViewById(d.ˋˋ);
        if (findViewById != null) {
            LayoutParams layoutParams = (LayoutParams) findViewById.getLayoutParams();
            layoutParams.setMarginStart(this.ॱ.getResources().getDimensionPixelSize(exp$a.ˊ) + (azb.ˊ(this.ॱ) + epv.ˊ()));
            layoutParams.setMarginEnd(azb.ˏ(this.ॱ));
        }
        azb.ˏ(inflate, d.ॱـ);
        return inflate;
    }

    protected BaseGiftCard ˏ(boolean z) {
        BaseGiftCard o_fby = new fby(this.ॱ, z, ʻ(), this.ॱॱ, this.ˏ);
        o_fby.ॱ(true);
        return o_fby;
    }

    public boolean ॱ() {
        return true;
    }

    public boolean ʽ() {
        return true;
    }

    public ArrayList<String> z_() {
        ArrayList<String> arrayList = new ArrayList();
        for (int i = 0; i < ˊॱ(); i++) {
            if (ˊ(i) instanceof VerticalScrollGiftListCard) {
                VerticalScrollGiftListCard verticalScrollGiftListCard = (VerticalScrollGiftListCard) ˊ(i);
                for (int i2 = 0; i2 < verticalScrollGiftListCard.ˋ(); i2++) {
                    cgz ˊ = verticalScrollGiftListCard.ˊ(i2);
                    if (ˊ instanceof fby) {
                        View ˉ = ˊ.ˉ();
                        if (ˉ != null && new dyf().ˎ(ˉ)) {
                            CardBean ˌ = ˊ.ˌ();
                            if (!(ˌ == null || dof.ॱ(ˌ.ॱॱ()))) {
                                arrayList.add(ˌ.ॱॱ() + "#$#" + ((BaseCardBean) ˌ).u_());
                            }
                        }
                    }
                }
            }
        }
        return arrayList;
    }
}
